<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
 
jimport('joomla.application.component.view');
 
class CouponsViewCodes extends JView
{
	protected $codes;
        
	// Overwriting JView display method
	function display($tpl = null) 
	{           
           $model = $this->getModel();
           $this->codes = $model->getCodes();
            
           JToolBarHelper::title(JText::_('COM_COUPONS_COUPONS').': '.JText::_('COM_COUPONS_COUPONS_CODES'));
           JToolBarHelper::cancel( 'cancel', 'COM_COUPONS_CLOSE' );
            
            // Check for errors.
            if (count($errors = $this->get('Errors'))) 
            {
                    JError::raiseError(500, implode('<br />', $errors));
                    return false;
            }

            parent::display($tpl);
	}
        
       
}
?>